//DOM获取
var hint = document.getElementById('hint');
var imgs = document.querySelectorAll('img');

for (let i = 0; i < imgs.length; i++) {
	imgs[i].onclick = function () {
		for (let j = 0; j < imgs.length; j++) {
			imgs[j].style.top = '-29px';
		}
		var t = i + 1;
		for (let k = 0;k <= i;k++) {
			imgs[k].style.top = '-9px';
		}
		hint.innerHTML = t + '颗星';
	}
}